import {
  mapState,
  mapMutations,
  mapActions
} from "vuex";



import {
  getMessageList
} from "@/assets/api/userCenterApi";

import {
  goTopSmooth,
  IEVersion,
} from "@/assets/utils/utils.js";


export default {
  computed: {
    ...mapState("common", {
      userInfo: (state) => state.userInfo,

    }),
  },
  data() {
    return {
      showButton: false,

    };
  },
  mounted() {

    // this.checkHref();

  },
  beforeDestroy() {},
  methods: {
    ...mapMutations("common", [
      "set_messageCount2",
      "noLookShool",
    ]),


    goTopSmooth() {
      goTopSmooth()
    },



    checkHref() {
      let host = window.location.host;

      let protocol = window.location.protocol;

      var url = document.location.toString();
      var arrUrl = url.split("//");

      var start = arrUrl[1].indexOf("/");
      var relUrl = arrUrl[1].substring(start); //stop省略，截取从start开始到结尾的所有字符
      if (protocol == "http:" && host == "www.xzcs2022.com") {
        window.location.replace("https://www.xzcs2022.com" + relUrl);
      }
      if (
        host == "www.xzcs2022.com" ||
        host == "mobile.xzcs2022.com" ||
        host == "m.xzcs2022.com" ||
        host == "dev-pc.xiaozhucaishui.com" ||
        host == "127.0.0.1:5173" ||
        host == "124.221.189.244" ||
        host == "123.56.89.141" ||
        host == "dev-pc.xzcs2022.com" ||
        host == "localhost:3000" ||
        host == "82.156.202.241" ||
        host == "test-pc.xiaozhucaishui.com"
      ) {} else {
        window.location.replace("https://www.xzcs2022.com" + relUrl);
      }
    },





  }
};
